<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
		try {
			ace.settings.check('breadcrumbs', 'fixed')
		} catch (e) {
		}
	</script>

	<ul class="breadcrumb">
		<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
		<li><a href="#">运营数据</a></li>
		<li class="active">渠道成功率查询</li>
	</ul>
</div>
<div class="page-content">
	<div class="page-header">
		<h1>渠道成功率列表</h1>
	</div><!-- end /.page-header -->
	
	<div class="row">
		<div class="col-xs-14">
			<table id="grid-table"></table>
			<div id="grid-pager"></div>
		</div><!-- end /.col -->
	</div><!-- end /.row -->
</div><!-- end /.page-content -->

<script type="text/javascript">
	jQuery(function($){
		datePick = function(elem){
			jQuery(elem).datepicker({
				format:'yyyymmdd',
				language: "zh-CN",
				autoclose:true
				});
		}
		
		var grid_selector = "#grid-table";
		var pager_selector = "#grid-pager";
		jQuery(grid_selector).jqGrid({
			url : '${basePath}/smsFeeRate/chRateList',
			datatype: 'json',
			mytype : 'POST',
			height: 400,
			colNames:['日期','渠道','渠道','产品','产品','SP','SP','国家','国家','资费','短信触发数','短信成功条数','发送成功率 %','上行条数','上行成功率 %','计费成功条数','下行成功率 %','计费成功率 %','计费成功金额'],
			colModel:[
			          {name:'separatorDate',index:'separatorDate',width:30,editable:false,
			        	  search:true,stype:"text",searchoptions:{dataInit:datePick,attr:{title:'选择日期'}},searchrules:{required:true,integer:true}},
			          {name:'channelId',index:'channelId',hidden:true,sortable:false,width:1,editable:false,
					      search:true,stype:"select",searchoptions:{value:'${channelKeyValues}',searchhidden:true},
					      viewable:false},
					  {name:'channelName',index:'channelName',editable:false,sortable:false,search:false,width:30},
					  {name:'productId',index:'productId',hidden:true,sortable:false,width:1,editable:false,
				          search:true,stype:"select",searchoptions:{value:'${productKeyValues}',searchhidden:true},
				          viewable:false},
				      {name:'productName',index:'productName',editable:false,sortable:false,search:false,width:30},
			          {name:'spId',index:'spId',hidden:true,sortable:false,width:1,editable:false,
				          search:true,stype:"select",searchoptions:{value:'${spKeyValues}',searchhidden:true},
				          viewable:false},
				      {name:'spName',index:'spName',editable:false,sortable:false,search:false,width:30},
			          {name:'countryId',index:'countryId',hidden:true,sortable:false,width:1,editable:false,
			        	  search:true,stype:"select",searchoptions:{value:'${countryKeyValues}',searchhidden:true},
			        	  viewable:false},
			          {name:'countryName',index:'countryName',editable:false,sortable:false,search:false,width:30},
			          {name:'tariff',index:'tariff',width:20},
			          {name:'smsCounts',index:'smsCounts',sortable:false,search:false,width:30},
			          {name:'smsSuccessCounts',index:'smsSuccessCounts',sortable:false,editable:false,search:false,width:40},
			          {name:'smsSendRate',index:'smsSendRate',sortable:false,search:false,width:30},
			          {name:'smsUpCounts',index:'smsUpCounts',sortable:false,editable:false,search:false,width:40},
			          {name:'smsUpSucessRate',index:'smsUpSucessRate',sortable:false,editable:false,search:false,width:40},
			          {name:'feeSuccessCounts',index:'feeSuccessCounts',sortable:false,editable:false,search:false,width:40},
			          {name:'downSuccessRate',index:'downSuccessRate',sortable:false,editable:false,search:false,width:40},
			          {name:'feeSuccessRate',index:'feeSuccessRate',sortable:false,editable:false,search:false,width:40},
			          {name:'feeSuccessAmount',index:'feeSuccessAmount',sortable:false,search:false,width:40},
			          ],
			         	jsonReader:{repeatitems:false},
			          	viewrecords : true,
						rowNum:10,
						rowList:[10,20,30,50,100,1000],
						pager : pager_selector,
						altRows: true,
						loadtext:'正在加载数据...',
						multiselect: true,
				        multiboxonly: true,
				        loadComplete:function(){
				        	var table = this;
				        	setTimeout(function(){
								updatePagerIcons(table);
								enableTooltips(table);
				        	},0);
				        },
				        caption:"渠道成功率列表",
				        autowidth:true
		});
		//引入jqgrid通用js 脚本
		<#include "/WEB-INF/common/_jqGrid2.html"/>
		
		function viewDetail(cellvalue,options,rowObject){
			var countryId = rowObject['countryId'];
			var countryName = rowObject['countryName'];
			return '<label class="rateDetail" onClick="detail('+countryId+');">'+countryName+'</label>';
		}
	});
	
	function detail(countryId){
		var url = "${basePath}/smsFeeRate/toOperRateList?cid="+countryId;
		$(".main-content").load(url);
		return false;
	}
</script>